-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a client context parameter to the modbus_t context, and getter/setter methods. #646
base: master
Are you sure you want to change the base?
Conversation
I'm reluctant to add any new field to _modbus struct (even more a free pointer not managed). |
Note that A common scenario in object-oriented languages like C++ or Swift is to wrap library data structures. In this case, I've defined a class This is a very common and widely-used pattern. |
@stephane Does that make sense? |
…bmodbus into rmann/add-context
I've added documentation for the new functions. |
Hi stephane and JetForMe. Are there any plans to merge that code with master? I haven't found the code from the pull request in the master branch. I have the same issue and the solution provided by JetForMe seems to be reasonable. |
When I use libgpiod to read/write the custom RTS IO, I need to at least keep track of the |
This commit adds
client_context
to the_modbus
structmodbus_set_client_context()
modbus_get_client_context()
The code otherwise ignores
_modbus.client_context
. It is available to calling code for it to associate its own context with the callback (typically a pointer to an object).